<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
	<?php $siteName = cr('cmsConfig.Backend.siteName');?>
	<?php echo $html->charset(); ?>
	<title>
		<?php
			//use title set for title tag only.else generated title.
			$pageTitle = $this->getVar('pageTitleTag');
			if(strlen($pageTitle) == 0)
			{
				$pageTitle = $title_for_layout;
			}
		?>
		<?php echo $siteName;?> :: <?php echo $pageTitle;?>
	</title>
	
	<script>
	var URL='<?php echo Configure::read("cmsConfig.Backend.siteUrl");?>/';
	var ErrorMsg = <?php echo $encodedErrorMsgs?>;
	</script>
	<?php
		echo $javascript->link(array('/js/jquery-1.7.2.min','/cms/js/main.js','/js/main.js','/cms/js/jquery.cookie.js'));
		echo $html->meta('icon');
		echo $html->meta('keywords',$this->getVar('metaKeywords'));
		echo $html->meta('description',$this->getVar('metaDescription'));
		echo $html->defaultCss(array('/cms/css/mod','/cms/css/mod_skins'));
		echo $html->css('common');
		echo $html->css('style');
		echo $html->css('breadcrumb');
		echo $javascript->getCompressedJs();
		echo $scripts_for_layout;
		echo $html->getCompressedCss();
		echo $startup_js;
		
		$metaCanonicalUrl = $this->getVar('metaCanonicalUrl');
		if($metaCanonicalUrl)
		{
			echo $html->meta(array('rel'=>'canonical'),null,array('link'=>Configure::read("cmsConfig.Backend.siteUrl").$metaCanonicalUrl));
		}
	?>
</head>

<body>
<?php 
if(!isset($hideSideBars))
{
	$hideSideBars = false;
}
?>
	<div id="container">

	<div class="wrapper">
	<div class="header">
			<div class="logo">
			<?php 
				echo $this->element('site_logo');
			?>
			</div>
				
		<?php echo $this->element('navigation_links');?>
	<div class="clear"></div>
	</div>
		
	
		<div class="main_content">
				<?php 
					$session->flash();	
				?>


		<!--	<div class="leftCol gMail sidebar">
				<?php
					if(isset($section) && $hideSideBars===false)
					{
						echo $section->render('left_sidebar');
					}
				?>				
			</div>	-->

			<div class="rightCol yahoo sidebar">
				<?php
					if(isset($section) && $hideSideBars===false)
					{
						echo $section->render('right_sidebar');
					}
				?>
			</div>

				<div class="main">
								<?php 
					if(!isset($breadCrumbVars))
					{
						$breadCrumbVars = array();
					}					
					if(cr('GeneralConfig.enable_breadcrumb') == 1)
					{
						if(isset($breadCrumb))
						{	
							$breadCrumb->breadCrumbElement = "bread_crumb_app";
							echo $breadCrumb->showFromPresentUrl();
						}
					}
					?>
	
<div class="clear"></div>
<div class="mid_box">
				<?php if((!isset($hideLayoutTitle) || $hideLayoutTitle != true) && $this->pageTitle){?>
				
				<h2><?php echo $this->pageTitle;?></h2>
				<?php }?>
				<?php
				if(isset($section))
				{
					echo $section->render('top');
				}
				?>
				<?php echo $content_for_layout; ?>
				<?php
				if(isset($section))
				{
					echo $section->render('bottom');
				}
				?>
			</div>			
</div>
<div class="clear"></div>
		</div>
		</div>
		<div class="clear"></div>
		<?php echo $this->element("footer")?>
	</div>
	</div>
<?php echo $cakeDebug; ?>	
</body>
</html>